package cn.com.sinosoft.test;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class MyServlet extends HttpServlet {
 
 public void doGet(HttpServletRequest request, HttpServletResponse response)
   throws ServletException, IOException {
  response.setContentType("text/html");
  int xlsxSize = 50000;
  int maxSize = 10000000;
  String rolegroup_id = "";
  String path = "";
  boolean inOrNotIn = false;
  xlsxSize = Integer.parseInt(request.getParameter("xlsxSize"));
  String maxSizeStr = request.getParameter("maxSize");
  if(maxSizeStr!=null && !"".equals(maxSizeStr)){
	  maxSize = Integer.parseInt(maxSizeStr);
  }
  rolegroup_id = request.getParameter("rolegroup_id");
  path = request.getParameter("path");
  String temp = request.getParameter("inOrNotIn");
  if("In".equals(temp)){
	  inOrNotIn = true;
  }
  System.out.println("xlsxSize"+xlsxSize);
  System.out.println("maxSize"+maxSize);
  System.out.println("rolegroup_id"+rolegroup_id);
  System.out.println("temp"+temp);
  System.out.println("inOrNotIn"+inOrNotIn);
  new TestExport().exportExcelPretCustList(xlsxSize,maxSize,path,rolegroup_id,inOrNotIn,request,response);
 }
 
 public void doPost(HttpServletRequest request, HttpServletResponse response)
   throws ServletException, IOException {
  response.setContentType("text/html");
 }
  
 public void init() throws ServletException {
   
 }
 
 
 public MyServlet() {
  super();
 }
  
 public void destroy() {
  super.destroy(); // Just puts "destroy" string in log
  // Put your code here
 }
}